<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.3">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.3" color="#222">





  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="Likianta Blog" type="application/atom+xml" />






<meta name="description" content="如图所示，本章的header就是我输入“ifm”三个字母并按下空格自动创建的内容。其中包含了Hexo post的所有参数，并且自动生成了文章id、文章的创建时间、更新时间以及文章的永久链接：  通过使用百度输入法自定义短语的时间戳语法（理论上国产的拼音输入法都有此功能），你可以快速、简洁地创建文章的header内容。">
<meta property="og:type" content="article">
<meta property="og:title" content="使用输入法自定义短语一步创建Hexo front-matter">
<meta property="og:url" content="https://likianta.coding.me/2017/1231233244/index.html">
<meta property="og:site_name" content="Likianta Blog">
<meta property="og:description" content="如图所示，本章的header就是我输入“ifm”三个字母并按下空格自动创建的内容。其中包含了Hexo post的所有参数，并且自动生成了文章id、文章的创建时间、更新时间以及文章的永久链接：  通过使用百度输入法自定义短语的时间戳语法（理论上国产的拼音输入法都有此功能），你可以快速、简洁地创建文章的header内容。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://ozurciydg.bkt.clouddn.com/18-1-1/40125280.jpg">
<meta property="og:image" content="http://ozurciydg.bkt.clouddn.com/18-1-1/7527518.jpg">
<meta property="og:updated_time" content="2018-01-06T05:40:55.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用输入法自定义短语一步创建Hexo front-matter">
<meta name="twitter:description" content="如图所示，本章的header就是我输入“ifm”三个字母并按下空格自动创建的内容。其中包含了Hexo post的所有参数，并且自动生成了文章id、文章的创建时间、更新时间以及文章的永久链接：  通过使用百度输入法自定义短语的时间戳语法（理论上国产的拼音输入法都有此功能），你可以快速、简洁地创建文章的header内容。">
<meta name="twitter:image" content="http://ozurciydg.bkt.clouddn.com/18-1-1/40125280.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://likianta.coding.me/2017/1231233244/"/>





  <title>使用输入法自定义短语一步创建Hexo front-matter | Likianta Blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Likianta Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tutorials">
          <a href="/tags/tutorial-catalog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            教程
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://likianta.coding.me/2017/1231233244/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Likianta">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Likianta Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">使用输入法自定义短语一步创建Hexo front-matter</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-12-31T23:32:44+08:00">
                2017-12-31
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/hexo/" itemprop="url" rel="index">
                    <span itemprop="name">Hexo</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  708
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  3
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>如图所示，本章的header就是我输入“ifm”三个字母并按下空格自动创建的内容。其中包含了Hexo post的所有参数，并且自动生成了文章id、文章的创建时间、更新时间以及文章的永久链接：</p>
<p><img src="http://ozurciydg.bkt.clouddn.com/18-1-1/40125280.jpg" alt=""></p>
<p>通过使用百度输入法自定义短语的时间戳语法（理论上国产的拼音输入法都有此功能），你可以快速、简洁地创建文章的header内容。</p>
<a id="more"></a>
<h1 id="百度输入法自定义短语的时间戳语法"><a href="#百度输入法自定义短语的时间戳语法" class="headerlink" title="百度输入法自定义短语的时间戳语法"></a>百度输入法自定义短语的时间戳语法</h1><p>以本篇文章的动图为例，其短语定义为：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">1,ifm=#&#123;Hexo front-matter&#125;#---</span><br><span class="line">\title: </span><br><span class="line">\id: $(month_mm)$(day_dd)$(fullhour)$(minute)$(second)</span><br><span class="line">\date: $(year)-$(month_mm)-$(day_dd) $(fullhour):$(minute):$(second)</span><br><span class="line">\updated: $(year)-$(month_mm)-$(day_dd) $(fullhour):$(minute):$(second)</span><br><span class="line">\categories: </span><br><span class="line">\tags:</span><br><span class="line">\permalink: https://likianta.coding.me/2018/category/$(month_mm)$(day_dd)$(fullhour)$(minute)$(second)/</span><br><span class="line">\---</span><br><span class="line">\</span><br></pre></td></tr></table></figure>
<p>下面依次来解释一下其中的含义：</p>
<p><strong>❶ <code>1,ifm=#{Hexo front-matter}#---</code></strong></p>
<p>开头数字1，表示位于候选项第一位，然后用英文逗号分隔，接着是输入码“ifm”，我取ifm的意思是：</p>
<ul>
<li>i - 基本上我把所有自定义语法都用i开头了</li>
<li>fm - 是“<a href="https://hexo.io/zh-cn/docs/front-matter.html" target="_blank" rel="noopener">front-matter</a>”的缩写，其实你也可以使用“header”来替代，可能会更好记忆</li>
</ul>
<p>然后写一个等号，等号后面写一个井号，百度就是通过<strong>开头的井号</strong>来识别内置语法的；</p>
<p>然后是一个花括号，花括号就是一个内置语法，百度会将花括号内的文字作为候选词显示；</p>
<p>接着又一个井号，<strong>百度会通过这个井号来识别接下来所有出现的内置语法。</strong></p>
<p><strong>❷ <code>\title:</code></strong></p>
<p>换行输入时，必须在开头写一个反斜杠。</p>
<p><strong>❸ <code>\id: $(month_mm)$(day_dd)$(fullhour)$(minute)$(second)</code></strong></p>
<p>这个是生成文章的唯一id。我的id命名规则为当前<code>月+日+时+分+秒</code>。每个表达式用<code>$</code>开头，然后跟一个括号，括号里是函数。</p>
<p><strong>❹ <code>\date: $(year)-$(month_mm)-$(day_dd) $(fullhour):$(minute):$(second)</code></strong></p>
<p>同理生成“2017-12-31 12:29:30”形式的时间戳。</p>
<p>以下略。</p>
<p>理论上搜狗输入法、QQ拼音输入法、讯飞输入法等都是支持此项功能的，具体可能会在语法上有细微的不同。</p>
<p>想要深入了解百度输入法的自定义短语语法，可以看这篇文章：<a href="https://likianta.coding.me/2018/DocManage/0101000134/">https://likianta.coding.me/2018/DocManage/0101000134/</a></p>
<hr>
<h1 id="permalink"><a href="#permalink" class="headerlink" title="permalink"></a>permalink</h1><p>由于我的permalink定义的是<code>年份/xx分类/文章id/</code>，所以基于上述语法就能自动组建一条永久链接了。</p>
<p>想要了解如何定义permalink可参考此篇文章第二小节：<a href="https://likianta.coding.me/2017/hexo/1230205746/">https://likianta.coding.me/2017/hexo/1230205746/</a></p>
<hr>
<h1 id="如何导入？"><a href="#如何导入？" class="headerlink" title="如何导入？"></a>如何导入？</h1><p>在 输入法设置 - 高级设置 - 更多 - 高级自定义短语窗口 中点击导入<a href="https://www.jianguoyun.com/p/DWUwm70QirnXBhi56T4" target="_blank" rel="noopener">此文件</a>：</p>
<p><img src="http://ozurciydg.bkt.clouddn.com/18-1-1/7527518.jpg" alt=""></p>
<hr>
<p>最后补一个<strong>更新日期</strong>的快捷短语：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">2,iu=#&#123;Hexo update&#125;#$(year)-$(month_mm)-$(day_dd) $(fullhour):$(minute):$(second)</span><br></pre></td></tr></table></figure>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/1231204322/" rel="next" title="10 Anykey整体重新设计">
                <i class="fa fa-chevron-left"></i> 10 Anykey整体重新设计
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/17039452/" rel="prev" title="创建你的输入法高级自定义短语（以PC版百度拼音输入法为例）">
                创建你的输入法高级自定义短语（以PC版百度拼音输入法为例） <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNDI4MS8xMDgxOA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg"
                alt="Likianta" />
            
              <p class="site-author-name" itemprop="name">Likianta</p>
              <p class="site-description motion-element" itemprop="description">Android Dev</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">73</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="http://blog.csdn.net/likianta" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-crosshairs"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:sheerish@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/likianta" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5441767757/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#百度输入法自定义短语的时间戳语法"><span class="nav-text">百度输入法自定义短语的时间戳语法</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#permalink"><span class="nav-text">permalink</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#如何导入？"><span class="nav-text">如何导入？</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Likianta</span>

  
</div>


  <div class="powered-by">
    <i class="fa fa-user-md"></i>
    <span id="busuanzi_container_site_pv">
      Site visitors:<span id="busuanzi_value_site_pv"></span>
    </span>
  </div>

<!--
  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.3</div>

-->



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">Site words total count:75.2k</span>
</div>
        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  





  

  

  

  
  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">

  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "box";
      
          pbOptions.boxForm = "horizontal";
      
          pbOptions.position = "bottomCenter";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Evernote";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
  </script>

  

  

  

  

</body>
</html>
